#ifndef __API_WIRELESS_MIC_H
#define __API_WIRELESS_MIC_H



typedef void (*module_input_t)(u8 *ptr, u32 samples, int ch_mode, void *param);
typedef void (*module_init_t)(u8 sample_rate, u16 samples);
typedef void (*module_set_callback_t)(module_input_t callback);

typedef struct {
    u8 module_type;
    u8 module_enable;
    module_init_t  module_init;
    module_input_t module_input;
    module_set_callback_t module_set_callback;
}ws_link_list_t;

void ws_link_list_init(ws_link_list_t *link_list, u8 module_count, u8 sample_rate, u16 samples);

typedef struct {
    volatile u16 len;
    volatile u8 *obuf;
    volatile u8 *wptr;
    volatile u8 *rptr;
    u8 *init_buf;
    u8 enable;
    u16 buf_len;
} cbuf_cfg_t;

void cbuf_init(cbuf_cfg_t *cbuf, u8 *buf, u16 buf_size);
void cbuf_input(u8 *ptr, u16 len, cbuf_cfg_t *emt);
bool cbuf_output(u8 *buf, u16 len, cbuf_cfg_t *emt);
u16  cbuf_total_len_get(cbuf_cfg_t *emt);

void cbuf_input_audio(u8 *ptr, u16 samples, cbuf_cfg_t *emt);
bool cbuf_output_audio(u8 *buf, u16 samples, cbuf_cfg_t *emt);
u16  cbuf_total_samples_get(cbuf_cfg_t *emt);


#endif // __API_WIRELESS_MIC_H
